#include "cartridge.h"
#include "z80.h"
#include "memory.h"
#include "vmgui.h"
#include "mnemonics.h"

int main(int argc, char *argv[])
{
	bool exit = false;
	UINT8 opcode;
	
	mem_init();
	prepare_vm();
	
	gui_init();
	
	do
	{
		gui_draw();
		
		char c = getch();
		
		if (c == 'q' || c == 'Q')
			exit = true;
		else if (c == 's' || c == 'S')
			opcode = fetch_instruction();
		
		gui_set_last_instr(mnemonics[opcode]);
	} while(!exit);
	
	gui_end();
	
	
	return 0;
}

